program Rectangle_;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Rectangle = class
  public
    a, b: integer;
  private
    s: integer;
    procedure squar; virtual;
    procedure update;
  end;

  SmartRectangle = class(Rectangle)
    procedure set_(a2, b2: integer);
    procedure squar; override;
  end;

  procedure Rectangle.squar;
  begin
    writeln(s);
  end;

  procedure Rectangle.update;
  begin
    s:=a*b;
  end;

  procedure SmartRectangle.set_(a2, b2 :integer );
  begin
    a:=a2;
    b:=b2;
    s:=a*b;
  end;

  procedure SmartRectangle.squar;
  begin
  if (s=a*b) then
  begin
    writeln(s)
  end else begin
    writeln('not true');
  end;
  end;
var
  a2, b2: integer;
  s: Rectangle;
  s1: SmartRectangle;
begin
  writeln('type a and b');
  readln(a2, b2);
  s:=Rectangle.Create;
  s.a:=a2;
  s.b:=b2;
  s.update;
  s.squar;
  s1:=SmartRectangle.Create;
  s1.set_(a2, b2);
  s1.squar;
  readln;
end.
